import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type Result = {
  code: String;
  data: any[] | Record<string, any>;
};
// 获取新闻列表
export const newsList = (params: object) => {
  return http.request<Result>("get", baseUrlApi("/getNewsList"), { params });
};
// 新闻详情
export const getNewsDetail = (params: object) => {
  return http.request<Result>("get", baseUrlApi("/getNewsDetail"), { params });
};
// 编辑新闻
export const NewEdit = (params: object) => {
  return http.request<Result>("post", baseUrlApi("/editNews"), {
    data: params
  });
};
// 新闻删除
export const NewsDelete = (params: object) => {
  return http.request<Result>("delete", baseUrlApi("/deleteNews"), { params });
};
